# -*- coding: utf-8 -*-
from flask_wtf import Form
from wtforms import StringField, PasswordField, BooleanField
from wtforms.validators import DataRequired, Length
__author__ = 'nibo'

class LoginForm(Form):
    """
    登录表单
    """
    email = StringField(default='', validators=[DataRequired(u'邮箱不能为空')])
    password = PasswordField(validators=[DataRequired(u'密码不能为空')])
    remember_me = BooleanField()


class NoteForm(Form):
    """
    记录表单
    """
    # 日期
    date = StringField(default='', validators=[DataRequired(u'日期不能为空')])
    # 内容
    content = StringField(default='', validators=[DataRequired(u'内容不能为空'),
                                                  Length(min=1, max=120,
                                                         message=u'内容不能超过120个字符')])
    # 备注
    remark = StringField(default='', validators=[Length(max=140, message=u'备注不能超过140个字符')])


